package com.shop.entity;

import java.util.HashSet;
import java.util.Set;
/*CREATE TABLE ordertb (
   `id` BIGINT(16) NOT NULL auto_increment PRIMARY KEY COMMENT '订单编号',
   `date` TIMESTAMP COMMENT '当前时间',
   `totalAmount` DOUBLE NULL COMMENT '优惠金额',
   `member_id` BIGINT(16) COMMENT '会员编号（外键）',
   foreign key (`member_id`) references member(`id`)
)ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;*/
/**
 * 
 * <b>一句话描述该类<b>
 * @author 威 
 * <br>2018年1月3日 下午1:43:06 
 *
 */
public class Order {
	private Integer id ;
	private String date ;
	private Double totalAmount ; //总金额
	private Member member ;						//会员外键 		n:1
	private Set<MerchantOrder> merchantOrders = new HashSet<MerchantOrder>() ; //商户订单表	1:n
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getDate() {
		return date;
	}
	public void setDate(String date) {
		this.date = date;
	}
	public Double getTotalAmount() {
		return totalAmount;
	}
	public void setTotalAmount(Double totalAmount) {
		this.totalAmount = totalAmount;
	}
	public Member getMember() {
		return member;
	}
	public void setMember(Member member) {
		this.member = member;
	}
	public Set<MerchantOrder> getMerchantOrders() {
		return merchantOrders;
	}
	public void setMerchantOrders(Set<MerchantOrder> merchantOrders) {
		this.merchantOrders = merchantOrders;
	}
	public String toString(){
		return "Order[id="+id+
				",date="+date+
				",totalAmount="+totalAmount+
				",memberId="+member.getId()+
				",merchantOrdersSize="+merchantOrders.size()+
				"]" ;
	}
}
